package com.cherrish.demo.algorithm.sort;

/**
 * @author cherrish
 * @time 2019-02-22 14:42
 * @name SortSelection
 * @desc:
 */
public class SortSelection implements ISort{
    @Override
    public void sort(int[] arr, int len) {
        for(int i = 0; i < len; i++){
            int min = i;
            for(int j = i; j < len; j++){
                if(arr[j] < arr[min]){
                    min = j;
                }
            }
            if(i != min){
                swap1(arr, i, min);
            }
        }
    }
}
